package cn.broadsense.thrid.api;

import cn.broadsense.thrid.constant.DaHuaApiUrlConstant;
import cn.broadsense.thrid.param.BasePageParam;
import cn.broadsense.thrid.param.BaseParam;
import cn.broadsense.thrid.utils.DaHuaHttpUtils;
import com.alibaba.fastjson2.JSONObject;
import org.springframework.stereotype.Component;

/**
 * db 透传相关接口
 *
 * @author pengxin
 * @date 2022-10-10 18:28
 */
@Component
public class DbRepository extends BaseRepository {

    /**
     * 查看算法-所需算力映射
     *
     * @return
     */
    public JSONObject computingCaps() {
        BaseParam param = new BasePageParam() {
            @Override
            public void checkParam() {


            }

            @Override
            public Class getResultClass() {
                return JSONObject.class;
            }
        };
        param.setUrl(url + DaHuaApiUrlConstant.DbApi.COMPUTING_CAPS);
        return DaHuaHttpUtils.getRest(getToken(), param);
    }

    /**
     * 获取视图智能能力集概要信息
     *
     * @return
     */
    public JSONObject summary() {
        BaseParam param = new BasePageParam() {
            @Override
            public void checkParam() {


            }

            @Override
            public Class getResultClass() {
                return JSONObject.class;
            }
        };
        param.setUrl(url + DaHuaApiUrlConstant.DbApi.SUMMARY);
        return DaHuaHttpUtils.getRest(getToken(), param);
    }

    /**
     * 硬件资源使用情况
     *
     * @return
     */
    public JSONObject intelligentCard() {
        BaseParam param = new BasePageParam() {
            @Override
            public void checkParam() {


            }

            @Override
            public Class getResultClass() {
                return JSONObject.class;
            }
        };
        param.setUrl(url + DaHuaApiUrlConstant.DbApi.INTELLIGENT_CARD);
        return DaHuaHttpUtils.getRest(getToken(), param);
    }
}
